package com.gxa.insurance.mapper;

import com.gxa.insurance.pojo.Admin;
import com.gxa.insurance.pojo.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Min
 */
public interface AdminMapper {
    Admin selectOne(Admin admin);

    Admin selectByPhone(String phone);

    /**
     * 通过手机号查找权限树
     * @param phone
     * @return
     */
    List<Permission> selectTreeByphone(String phone);

    Integer updateLoginTime(Map<String,Object> map);

    List<Admin> selectAllByPage(Integer page,Integer pageSize);

    void insertAdmin(Admin admin);

    void update(Admin admin);

    Long selectCount();

    void updateIsEnable(@Param("isEnable") Boolean isEnable, @Param("id") Integer id);

    Integer insertAdminRole(HashMap<String, Integer> map);

    void updateRole(Admin admin);

    /**
     * 删除管理员用户通过ID
     * @param id
     */
    void deleteAdminById(Integer id);

    void deleteAdminRoleByAdminId(Integer id);
}
